package com.css.crm.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.css.crm.dao.PerformTransactionDao;
import com.css.crm.vo.PerformTransactionVo;

/**
 * Implementation for PerformTxnDao
 * 
 * @author ais
 */
public class PerformTransactionDaoImpl extends BaseDaoImpl implements PerformTransactionDao {

	public PerformTransactionDaoImpl() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.PerformTxnDao#getPerformTxnById(java.lang.String)
	 */
	@Override
	public PerformTransactionVo getPerformTransactionById(String id) {

		SqlSession session = getMyBatisSession();
		return session.selectOne("performTransaction.getPerformTransactionById", id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.PerformTransactionDao#deletePerformTransactionById(java.lang.String)
	 */
	@Override
	public int deletePerformTransactionById(String id) {

		SqlSession session = getMyBatisSession();
		return session.delete("performTransaction.deletePerformTransactionById", id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.PerformTransactionDao#insertPerformTransaction(com.css.crm.vo.PerformTransactionVo
	 * )
	 */
	@Override
	public int insertPerformTransaction(PerformTransactionVo vo) {

		SqlSession session = getMyBatisSession();
		return session.insert("performTransaction.insertPerformTransaction", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.PerformTransactionDao#updatePerformTransaction(com.css.crm.vo.PerformTransactionVo
	 * )
	 */
	@Override
	public int updatePerformTransaction(PerformTransactionVo vo) {

		SqlSession session = getMyBatisSession();
		return session.update("performTransaction.updatePerformTransaction", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.PerformTransactionDao#queryPerformTransaction(com.css.crm.vo.PerformTransactionVo
	 * )
	 */
	@Override
	public List<PerformTransactionVo> getPerformTransaction(PerformTransactionVo vo) {

		SqlSession session = getMyBatisSession();
		return session.selectList("performTransaction.getPerformTransaction", vo);
	}

}
